import http from "../request.js";

const header = { "Content-Type": "application/x-www-form-urlencoded" };
class MineCenter {
  constructor() {
		this.get_config_Api =      "/api/index/get_config";                 // 报背景图片 (个人中心)
		
		this.Ccdetails_Api =        "/api/log/Ccdetails";                   // 账号明细
		this.reward_arr_Api =       "/api/log/reward_arr";                  // 奖金类型列表
		this.reward_list_Api =      "/api/log/reward_list";                 // 奖金明细
		
		this.withdrawTx_list_Api =  "/api/withdraw/tx_list";                // 提现记录
    this.withdrawApi =          "/api/withdraw/tx_show";                // 提现页面信息
    this.txConfigApi =          "/api/withdraw/txConfig";                // 提现页面信息
    this.withdrawtx_applyApi =  "/api/withdraw/tx_apply";               // 提现
		
    this.vip_rechargeApi =      "/api/hqshop/recharge/vip_recharge";    // 生成vip订单
    this.vip_payApi =           "/api/hqshop/recharge/vip_pay";         // vip订单余额支付

		this.couponlistApi =        "/api/coupon/coupon/couponlist";        // 优惠券列表
		this.getMerchCouponApi =    "/api/coupon/coupon/getMerchCoupon";    // 可领取优惠券列表
		this.getcouponApi =         "/api/coupon/coupon/getcoupon";         // 领取优惠券
		
		this.applyIndexApi =        "/api/hqmerch/apply/index";             // 商户入驻配置信息
		this.applyAddApi =          "/api/hqmerch/apply/add";               // 商户入驻
        this.applyAddXWApi =          "/api/hqmerch/apply/add2";               // 小微入驻
		this.applyEditXWApi =          "/api/hqmerch/apply/edit";               // 小微入驻
		this.applyRecallApi =          "/api/hqmerch/apply/recall";               // 撤销申请
	
        this.my_teamApi =           "/api/user/my_team";                    // 我的团队
		
		this.getMessageApi =        "/api/message/message/getMessage"       // 消息列表
		this.getCounterApi =        "/api/counter/counter/getCounter"       // 我的还价列表
		this.Counter_recordApi =    "/api/counter/counter/Counter_record"   // 还价记录
		this.buyer_counter_detailApi = "/api/counter/counter/buyer_counter_detail"   // 还价详情
		this.other_counterApi =     "/api/counter/counter/other_counter"    // 其他还价
		this.buyer_counterApi =     "/api/counter/counter/buyer_counter"    // 买家继续还价, 取消
		this.seller_counter_detailApi =  "/api/counter/counter/seller_counter_detail"    // 卖家详情
		this.seller_huanjiaApi =    "/api/hqshop/order/seller_huanjia"      // 卖家还价
		this.commitCounterOrderApi ="/api/counter/counter/commit_counter_order" // 下订单接口
		
		this.turntableApi =         "/api/sale/turntable/getlist";          // 大转盘数据
		this.zhuanget_configApi =   "/api/sale/turntable/get_config";       // 大转盘规则，活动名称等
		this.chouget_timeApi =      "/api/sale/turntable/get_time";         // 获取抽奖机会
		this.getrewardApi =         "/api/sale/turntable/getreward";        // 大转盘点击抽奖
		this.chougetlogsApi =       "/api/sale/turntable/getlog";           // 抽奖记录
		this.rankingVipApi =       "/api/ranking/vip";           			// 直推VIP数排行榜
		this.rankingSaleApi =       "/api/ranking/sale";           			// 团队业绩排行榜
		this.transferApi =       "/api/transfer/transfer";           			// 转换申请
		this.transferSendApi =       "/api/transfer/send";           			// 记账点转赠
		this.merchSendApi =           '/api/transfer/merchSend'                // 赠送贡献值
		this.getMerchSendDataApi = '/api/transfer/getMerchSendData'           // 获取需要的记账点
		this.dgpGetAwardInfoApi =       "/api/dgp/getAwardInfo";           			// 奖励计划页面数据
		this.dgpwithdrawApi	 =       "/api/dgp/withdraw";           			// 奖励计划提现
		this.getbranchApi	 =       "/api/index/getBranch";           			// 银行支行编码 编码二级联动查询
  }
	getConfig(params){ // 报背景图片 (个人中心)
		return http.post(this.get_config_Api, params || {}).then((res) => res.data);
	}	
	Ccdetails(params){  // 账户明细
		return http.post(this.Ccdetails_Api, params || {}, {header}).then((res) => res.data);
	}
	rewardArr(params){  // 奖金类型列表
		return http.post(this.reward_arr_Api, params || {}, {header}).then((res) => res.data);
	}
	rewardList(params){  // 奖金明细
		return http.post(this.reward_list_Api, params || {}, {header}).then((res) => res.data);
	}
	couponlist(params){  // 优惠券列表
		return http.post(this.couponlistApi, params || {}, {header}).then((res) => res.data);
	}
	getMerchCoupon(params){  // 可领取优惠券列表
		return http.post(this.getMerchCouponApi, params || {}, {header}).then((res) => res.data);
	}
	getcoupon(params){  // 领取优惠券
		return http.post(this.getcouponApi, params || {}, {header}).then((res) => res.data);
	}
	
	withdrawTxList(params){  // 提现记录
		return http.post(this.withdrawTx_list_Api, params || {}, {header}).then((res) => res.data);
	}
  withdraw(params){  // 提现页面信息
  	return http.post(this.withdrawApi, params || {}, {header}).then((res) => res.data);
  }
  txConfig(params){  // 提现页面信息
  	return http.post(this.txConfigApi, params || {}, {header}).then((res) => res.data);
  }
  withdrawtx_apply(params){  // 提现
  	return http.post(this.withdrawtx_applyApi, params || {}, {header}).then((res) => res.data);
  }
  tx_apply2(params){  // 提交提现
  	return http.post('/api/withdraw/tx_apply2', params || {}, {header}).then((res) => res.data);
  }
	
	vip_recharge(params){  // 生成vip订单
		return http.post(this.vip_rechargeApi, params || {}, {header}).then((res) => res.data);
	}
	vip_pay(params){  // vip订单余额支付
		return http.post(this.vip_payApi, params || {}, {header}).then((res) => res.data);
	}
  
  applyIndex(params){  // 商户入驻配置信息
		return http.post(this.applyIndexApi, params || {}, {header}).then((res) => res.data);
	}
	applyAdd(params){  // 商户入驻
		return http.post(this.applyAddApi, params || {}, {header}).then((res) => res.data);
	}
	applyAddXW(params){  // 小微入驻
		return http.post(this.applyAddXWApi, params || {}, {header}).then((res) => res.data);
	}
	applyEditXW(params){  // 小微入驻编辑
		return http.post(this.applyEditXWApi, params || {}, {header}).then((res) => res.data);
	}
  applyRecall(params){  // 撤销申请
  	return http.post(this.applyRecallApi, params || {}, {header}).then((res) => res.data);
  }
  my_team(params){  // 我的团队
  	return http.post(this.my_teamApi, params || {}, {header}).then((res) => res.data);
  }
	
	getMessage(params){  // 消息列表
		return http.post(this.getMessageApi, params || {}, {header}).then((res) => res.data);
	}
	getCounter(params){  // 我的还价列表（买家）接口
		return http.post(this.getCounterApi, params || {}, {header}).then((res) => res.data);
	}
	Counter_record(params){  // 还价记录
		return http.post(this.Counter_recordApi, params || {}, {header}).then((res) => res.data);
	}
	buyer_counter_detail(params){  // 还价详情
		return http.post(this.buyer_counter_detailApi, params || {}, {header}).then((res) => res.data);
	}
	other_counter(params){  // 其他还价
		return http.post(this.other_counterApi, params || {}, {header}).then((res) => res.data);
	}
	buyer_counter(params){  // 买家继续还价, 取消
		return http.post(this.buyer_counterApi, params || {}, {header}).then((res) => res.data);
	}
	seller_counter_detail(params){  // 卖家详情
		return http.post(this.seller_counter_detailApi, params || {}, {header}).then((res) => res.data);
	}
	seller_huanjia(params){  // 卖家还价
		return http.post(this.seller_huanjiaApi, params || {}, {header}).then((res) => res.data);
	}
	commitCounterOrder(params){  // 下订单接口
		return http.post(this.commitCounterOrderApi, params || {}, {header}).then((res) => res.data);
	}
	
	turntable(params){  // 大转盘数据
		return http.post(this.turntableApi, params || {}, {header}).then((res) => res.data);
	}
	zhuanget_config(params){  // 大转盘配置
		return http.post(this.zhuanget_configApi, params || {}, {header}).then((res) => res.data);
	}
	chouget_time(params){  // 获取抽奖机会
		return http.post(this.chouget_timeApi, params || {}, {header}).then((res) => res.data);
	}
	getreward(params){  // 大转盘点击抽奖
		return http.post(this.getrewardApi, params || {}, {header}).then((res) => res.data);
	}
	chougetlogs(params){  // 抽奖记录
		return http.post(this.chougetlogsApi, params || {}, {header}).then((res) => res.data);
	}
	rankingVip(params){  // 直推VIP数排行榜
		return http.post(this.rankingVipApi, params || {}, {header}).then((res) => res.data);
	}
	rankingSale(params){  // 团队业绩排行榜
		return http.post(this.rankingSaleApi, params || {}, {header}).then((res) => res.data);
	}
	transfer(params){  // 转换申请
		return http.post(this.transferApi, params || {}, {header}).then((res) => res.data);
	}
	transferSend(params){  // 记账点转赠
		return http.post(this.transferSendApi, params || {}, {header}).then((res) => res.data);
	}
	merchSend(params){  // 赠送贡献值
		return http.post(this.merchSendApi, params || {}, {header}).then((res) => res.data);
	}
	
	getMerch(params){  // 获取需要的记账点
		return http.post(this.getMerchSendDataApi, params || {}, {header}).then((res) => res.data);
	}
	dgpGetAwardInfo(params){  // 奖励计划页面数据
		return http.post(this.dgpGetAwardInfoApi, params || {}, {header}).then((res) => res.data);
	}
	dgpwithdraw(params){  // 奖励计划页面提现
		return http.post(this.dgpwithdrawApi, params || {}, {header}).then((res) => res.data);
	}
	getbranchList(params){  // 银行支行编码 编码二级联动查询
		return http.post(this.getbranchApi, params || {}, {header}).then((res) => res.data);
	}
	submitPointsRecharge(params){  // 充值积分
		return http.post('/api/user/submitPointsRecharge', params || {}, {header}).then((res) => res.data);
	}
	submitPointsWithdrawal(params){  // 提现积分
		return http.post('/api/user/submitPointsWithdrawal', params || {}, {header}).then((res) => res.data);
	}
	getMyConfig(params){  // 提现积分
		return http.get('/api/index/getMyConfig', params || {}, {header}).then((res) => res.data);
	}
}

export const MineCenterApi = new MineCenter();
